import Vue from "vue";
import Router from "vue-router";
import Login from "./views/Login.vue";
import Transition from "./views/Transition";
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/transition",
      name: "transition",
      component: Transition
    },
    {
      path: "/login",
      name: "login",
      component: Login
    },
    {
      path: "/err",
      name: "错误页面",
      component: () => import(/* webpackChunkName: "about" */ "./components/common/404.vue")
    },
    {
      path: "/",
      component: () => import(/* webpackChunkName: "about" */ "./views/Main.vue"),
      meta: { requireAuth: true },
      redirect: { path: "/plaintList" },
      children: [
        {
          path: "/home",
          component: () => import(/* webpackChunkName: "about" */ "./components/Home.vue"),
          name: "首页"
        },
        {
          path: "/wait",
          name: "待开发页面",
          component: () => import(/* webpackChunkName: "about" */ "./components/common/wait.vue")
        },
        {
          path: "/plaintList",
          name: "诉状列表",
          component: () => import(/* webpackChunkName: "about" */ "./components/plaint/PlaintList.vue")
        },
        {
          path: "/addPlaint",
          name: "新增诉状",
          component: () => import(/* webpackChunkName: "about" */ "./components/plaint/addPlaint.vue")
        }
      ]
    }
  ]
});
